package cn.lut.service.impl;

import cn.lut.dao.StudentDao;
import cn.lut.entity.Student;
import cn.lut.service.StudentService;

import java.util.List;

/**
 * @user:dell
 * @date:2020年10月31 10:33
 */
public class StudentServiceImpl  implements StudentService {
//    引用类型
    private StudentDao studentDao;

    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public int addStudent(Student student) {
        int nums = studentDao.insertStudent(student);
        return nums;
    }

    @Override
    public List<Student> queryStudents() {
        List<Student> students = studentDao.selectAllStudents();
        return students;
    }
}
